package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CommunityPicMapper;
import com.ruoyi.system.domain.CommunityPic;
import com.ruoyi.system.service.ICommunityPicService;
import com.ruoyi.common.core.text.Convert;

/**
 * 社群背景墙图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class CommunityPicServiceImpl implements ICommunityPicService 
{
    @Autowired
    private CommunityPicMapper communityPicMapper;

    /**
     * 查询社群背景墙图片
     * 
     * @param id 社群背景墙图片主键
     * @return 社群背景墙图片
     */
    @Override
    public CommunityPic selectCommunityPicById(String id)
    {
        return communityPicMapper.selectCommunityPicById(id);
    }

    /**
     * 查询社群背景墙图片列表
     * 
     * @param communityPic 社群背景墙图片
     * @return 社群背景墙图片
     */
    @Override
    public List<CommunityPic> selectCommunityPicList(CommunityPic communityPic)
    {
        return communityPicMapper.selectCommunityPicList(communityPic);
    }

    /**
     * 新增社群背景墙图片
     * 
     * @param communityPic 社群背景墙图片
     * @return 结果
     */
    @Override
    public int insertCommunityPic(CommunityPic communityPic)
    {
        communityPic.setCreateTime(DateUtils.getNowDate());
        return communityPicMapper.insertCommunityPic(communityPic);
    }

    /**
     * 修改社群背景墙图片
     * 
     * @param communityPic 社群背景墙图片
     * @return 结果
     */
    @Override
    public int updateCommunityPic(CommunityPic communityPic)
    {
        communityPic.setUpdateTime(DateUtils.getNowDate());
        return communityPicMapper.updateCommunityPic(communityPic);
    }

    /**
     * 批量删除社群背景墙图片
     * 
     * @param ids 需要删除的社群背景墙图片主键
     * @return 结果
     */
    @Override
    public int deleteCommunityPicByIds(String ids)
    {
        return communityPicMapper.deleteCommunityPicByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除社群背景墙图片信息
     * 
     * @param id 社群背景墙图片主键
     * @return 结果
     */
    @Override
    public int deleteCommunityPicById(String id)
    {
        return communityPicMapper.deleteCommunityPicById(id);
    }
}
